package com.enjoyor.soa.traffic.core.tpcms.mapper.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.enjoyor.soa.traffic.core.tpcms.constant.PassVehicleSqlId;
import com.enjoyor.soa.traffic.core.tpcms.domain.PassVehicle;
import com.enjoyor.soa.traffic.core.tpcms.mapper.IPassVehicleMapper;
import com.enjoyor.soa.traffic.frame.support.mybatis.mapper.impl.BaseMapper;

@Service
@Transactional
public class PassVehicleMapper extends BaseMapper<PassVehicle> implements IPassVehicleMapper {

    /*
     * @Override public void insert(PassVehicle passVehicle) {
     * passVehicle.setApplyVehicleId("V" + String.valueOf(System.nanoTime()));
     * super.insert(passVehicle); }
     */

    @Override
    public List<PassVehicle> getVehicleList(Map<String, Object> map) {
        return sqlSessionTemplate.selectList(getSqlName(PassVehicleSqlId.SQL_SELECT_LIST), map);
    }

    @Override
    public int deleteVehicleByApplyId(String passApplyId) {
        return sqlSessionTemplate.delete(getSqlName(PassVehicleSqlId.SQL_DELETE), passApplyId);
    }

}
